import { newRequest } from '@/utils/newRequest'
import request from '@/utils/request'

//获取排程列表
export function getProductionPlanList(params) {
  return newRequest({
    url: '/api/Doing/GetProductionPlanList',
    method: 'get',
    params: {
      ...params
    }
  })
}

//开始打印
// export function startPrintProductionPlan(data){
//     return newRequest({
//         url: '/api/Doing/StartPrintProductionPlan',
//         method: 'post',
//         data: {
//             ...data
//         }
//     })
// }

//打印控制列表查询
/**
 * @deprecated
 * @param params
 * @returns {*}
 */
export function getPrintControlList(params) {
  return newRequest({
    url: '/api/Doing/GetPrintControlList',
    method: 'get',
    params: {
      ...params
    }
  })
}

export function GetAutoProductionPlansForPrint(data) {
  return request({
    url: '/GetAutoProductionPlansForPrint',
    method: 'post',
    data
  })
}

export function ModifyOrderAutoPlanPrintStatus({ OrderAutoPlanId, PrintStauts } = {}) {
  return request({
    url: '/ModifyOrderAutoPlanPrintStatus',
    method: 'post',
    data: { OrderAutoPlanId, PrintStauts }
  })
}

export function ModifyOrderAutoPlanListPrintStatus(data) {
  return request({
    url: '/ModifyOrderAutoPlanListPrintStatus',
    method: 'post',
    data
  })
}

export function GetLineMaterialItem({ lineId } = {}) {
  return request({
    url: '/GetLineMaterialItem',
    method: 'post',
    params: { lineId }
  })
}

//提交打印控制器
export function commitPrintControl(data) {
  return newRequest({
    url: '/api/Doing/CommitPrintControl',
    method: 'post',
    data: {
      ...data
    }
  })
}

//暂停打印
export function pausePrintProductionPlan(data) {
  return newRequest({
    url: '/api/Doing/PausePrintProductionPlan',
    method: 'post',
    data: {
      ...data
    }
  })
}

//取消打印
export function cancelPrintProductionPlan(data) {
  return newRequest({
    url: '/api/Doing/CancelPrintProductionPlan',
    method: 'post',
    data: {
      ...data
    }
  })
}

//物料列表查询
export function getMaterialItemList(params) {
  return newRequest({
    url: '/api/Plan/GetMaterialItemList',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 获取排程配置
export function getOrderAutoPlanListOfLine(params) {
  return newRequest({
    url: '/api/Doing/GetOrderAutoPlanListOfLine',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 获取排程照片列表
export function getOrderFilesVoOfProductionPlan(params) {
  return newRequest({
    url: '/api/Doing/GetOrderFilesVoOfProductionPlan',
    method: 'get',
    params: {
      ...params
    }
  })
}
